package cn.demo.gecco.geccobean;

import com.geccocrawler.gecco.annotation.*;
import com.geccocrawler.gecco.request.HttpRequest;
import com.geccocrawler.gecco.spider.HtmlBean;

import java.util.List;

/**
 * @ClassName:
 * @PackageName: cn.demo.gecco.geccobean
 * @author: youjp
 * @create: 2019-11-06 15:12
 * @description: TODO 获取所有房屋列表
 * 接口HtmlBean：说明该类是一个解析html页面的爬虫
 * 注解@Gecco：告知该爬虫匹配的url格式(matchUrl)和
 * 内容抽取后的bean处理类（pipelines处理类采用管道过滤器模式，可以定义多个处理类）。
 *
 * @Version: 1.0
 */
@Gecco(matchUrl = "https://shanghai.anjuke.com/sale/{data}/", pipelines = {"nextPageSortPipeline","downPicPipeline"})
public class NextPageSort implements HtmlBean {


    @Request
    private HttpRequest request;

    @HtmlField(cssPath = "#content > div.sale-left  #houselist-mod-new li")
    private List<HouseInfo> houseInfoList;

    /**
     * 下一页 url
     */
    @Href
    @HtmlField(cssPath = "#content > div.sale-left > div.multi-page > a.aNxt")
    private String nextPage;

    @RequestParameter
    private String data;

    public HttpRequest getRequest() {
        return request;
    }

    public void setRequest(HttpRequest request) {
        this.request = request;
    }

    public List<HouseInfo> getHouseInfoList() {
        return houseInfoList;
    }

    public void setHouseInfoList(List<HouseInfo> houseInfoList) {
        this.houseInfoList = houseInfoList;
    }

    public String getNextPage() {
        return nextPage;
    }

    public void setNextPage(String nextPage) {
        this.nextPage = nextPage;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }
}
